<template>
  <div class="card" :style="[{ height: height }]">
    <div class="card-title">
      <div class="card-title-left bigscreen-font-title">{{ title }}</div>
      <div v-if="rightTitle" class="card-title-right" @click="toRight">
        <div>{{ rightTitle }}</div>
      </div>
    </div>
    <div class="card-content" :style="contentStyle">
      <slot />
    </div>
  </div>
</template>
<script>
export default {
  components: {},
  props: {
    title: String,
    rightTitle: String,
    size: String,
    padding: String,
    type: String,
    height: {
      type: String,
      default: '100%'
    },
    showTitle: {
      type: Boolean,
      default: true
    }
  },
  data() {
    return {}
  },
  computed: {
    contentStyle() {
      return {
        padding: this.padding || '20px'
      }
    }
  },
  methods: {
    toRight() {
      this.$emit('click-right')
    }
  }
}
</script>
<style lang="scss" scoped>
.card {
  width: 100%;

  &-title {
    height: 40px;
    background: url("../assets/images/common/title-header-bg.png");
    background-size: 100% 45px;
    padding: 0px 30px;
    display: flex;
    align-items: center;
    gap: 25px;
    &-left {
      font-size: 24px;
      font-weight: 400;
      color: #ffffff;
      text-shadow: 5px 5px 8px rgba(24, 200, 255, 0.51);
      font-size: 20px;
      font-weight: bold;
      color: #d2f1f1;
    }

    &-right {
      font-size: 12px;
      font-family: Source Han Sans SC;
      font-weight: 400;
      color: #53caaf;

      img {
        width: 14px;
        height: 14px;
        margin-bottom: -4px;
        margin-left: 10px;
      }
    }
  }

  &-content {
    height: calc(100% - 40px);
    background: rgba(27, 37, 34, 0.6);
    border: 2px solid;
    border-image: linear-gradient(
        0deg,
        rgba(81, 226, 193, 0.3),
        rgba(255, 255, 255, 0.3),
        rgba(81, 226, 194, 0.3)
      )
      2 2;
    color: #fff;
    padding: 20px;
  }
}
</style>
